#pragma once

#include <stack>

#include "Singleton.h"
#include "WinMutex.h"
#include <SFML\Network.hpp>
#include "Packet.h"
#include "WinThread.h"
#include "GameState.h"
#include "Player.h"

class DataBase : public Singleton<DataBase>
{
	friend class Singleton<DataBase>;
	
private:
	DataBase(void);
	~DataBase(void);

	Player							m_currentPlayer;
	WinMutex						m_mutexCurrentPlayer;

	std::vector<Player>				m_players;
	WinMutex						m_mutexPlayers;

	GameState						m_state;
	WinMutex						m_mutexState;
	
public:
	void							initDatabase();

	//PLAYER
	void							setCurrentPlayer(Player);
	Player							getCurrentPlayer();					

	//CLIENTS
	void							pushBackPlayer(Player);
	void							erasePlayerNumber(int);
	int								getSizePlayer();
	Player							getElementAt(int);
	void							modifyPlayer(Player);
		
	//STATE
	GameState						getCurrentState();
	void							setState(GameState);
};